package com.qjdchina.sku.converter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.qjdchina.sku.model.HardcoverCost;
import com.qjdchina.sku.model.vo.HardcoverCostVO;

public class HardcoverCostConverter {

	
	private HardcoverCostConverter(){
		
	}
	/**
	 * HardcoverCost to HardcoverCostVO
	 * @param hardcoverCost
	 * @return
	 */
	public static HardcoverCostVO toHardcoverCostVO(HardcoverCost hardcoverCost){
		
		HardcoverCostVO hardcoverCostVO=new HardcoverCostVO();
		if (null==hardcoverCost) {
			return hardcoverCostVO;
		}
		BeanUtils.copyProperties(hardcoverCost, hardcoverCostVO);
		return hardcoverCostVO;
	}
	/**
	 * HardcoverCostVO to HardcoverCost
	 * @param hardcoverCostVO
	 * @return
	 */
	public static HardcoverCost toHardcoverCost(HardcoverCostVO hardcoverCostVO){
		
		HardcoverCost hardcoverCost=new HardcoverCost();
		if (null==hardcoverCostVO) {
			return hardcoverCost;
		}
		BeanUtils.copyProperties(hardcoverCostVO, hardcoverCost);
		return hardcoverCost;
	}
	/**
	 * List<HardcoverCost> to List<HardcoverCostVO>
	 * @param hardcoverCosts
	 * @return
	 */
	public static List<HardcoverCostVO> toHardcoverCostVOs(List<HardcoverCost> hardcoverCosts){
		
		if (null==hardcoverCosts) {
			return Collections.emptyList();
		}
		List<HardcoverCostVO> hardcoverCostVOs=new ArrayList<HardcoverCostVO>();
		for (HardcoverCost hardcoverCost : hardcoverCosts) {
			hardcoverCostVOs.add(HardcoverCostConverter.toHardcoverCostVO(hardcoverCost));
		}
		return hardcoverCostVOs;
	}
	

}
